//
//  CheckInputCell.m
//  PropertyMananger
//
//  Created by Mansion on 17/2/24.
//  Copyright © 2017年 BH. All rights reserved.
//

#import "CheckFromInputCell.h"

@implementation CheckFromInputCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString * CellID = @"CheckInputCellID";
    CheckFromInputCell * cell = [tableView dequeueReusableCellWithIdentifier:CellID];
    if (!cell) {
        
        cell = [[CheckFromInputCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellID];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.iconImg = [[UIImageView alloc]init];
        [self.contentView addSubview:self.iconImg];
        self.iconImg.image = IMG(@"ico_work_order_repair");
        
        [self.iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.leading.equalTo(self.contentView).with.offset(15);
            make.centerY.equalTo(self.contentView).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(20, 20));
        }];
        
        
        self.titleLabel = [[UILabel alloc]init];
        [self.contentView addSubview:self.titleLabel];
        self.titleLabel.font = BHFont(15);
        self.titleLabel.textAlignment = NSTextAlignmentLeft;
        self.titleLabel.textColor = BHColor(102,102, 102);
        self.titleLabel.text = @"房号";
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.iconImg.mas_trailing).with.offset(15);
            make.centerY.equalTo(self.contentView).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(70, 30));
        }];
        
        UIView * lineView = [[UIView alloc]init];
        [self.contentView addSubview:lineView];
        lineView.backgroundColor = BHGrayColor;
        
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            
            make.left.equalTo(self.contentView).with.offset(15);
            make.bottom.equalTo(self.contentView).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW - 15, 1));
        }];
        
        //用户名
        self.inputTF = [[UITextField alloc]init];
        [self.contentView addSubview:self.inputTF];
        self.inputTF.placeholder = @"请输入房号";
        self.inputTF.font = BHFont(15);
    
        // self.inputTF.backgroundColor = [UIColor redColor];
        
        [self.inputTF mas_makeConstraints:^(MASConstraintMaker *make) {
            make.leading.equalTo(self.titleLabel.mas_trailing).with.offset(20);
            make.centerY.equalTo(self.titleLabel).with.offset(0);
            make.size.mas_equalTo(CGSizeMake(BHscreenW - 80, 30));
        }];
        
        
    }
    
    return self;
}

@end
